package config

// AuthConf is a JWT config
type AuthConf struct {
	AccessSecret string `json:",optional,env=AUTH_SECRET"`
	AccessExpire int64  `json:",optional,env=AUTH_EXPIRE"`
}

type AuthorityConf struct {
	APIWhiteList          []string `json:"apiWhiteList,optional"`
	SkipAPIAuthorityCheck bool     `json:"skipAPIAuthorityCheck,optional,default=false"`
}

type AuthBackend struct {
	Client          Application `json:"client"`
	AuthenticateURL string      `json:"authenticateURL"`
	UserIDField     string      `json:"userIDField,optional,default=userId"`
	TenantIDField   string      `json:"tenantIDField,optional,default=tenantId"`
}

type Authenticators struct {
	Backends []*AuthBackend `json:"backends"`
}
